package form

import (
	"yak.admin/src/entity"
	"yak.admin/src/util"
)

type DiscussWanjieForm struct {
	Pid       int `form:"pid" validate:"required" chn:"Pid"`
}

func (form *DiscussWanjieForm) Wanjie() bool {
	db := util.GetMysqlPool().Handler()
	if db.Model(entity.ReportDiscussCategory{}).Where("pid = ?", form.Pid).Update("status", 2).RowsAffected > 0 {
		return true
	}
	return false
}
